package com.goodfather.textbook.youdao.pad.network;


import android.content.Context;

import com.lzy.okgo.model.HttpHeaders;
import com.goodfather.textbook.youdao.pad.util.AppUtils;

/**
 * Created by PVer on 2018/3/26.
 */

public class ApiConstant {

    public static int SUCCESS = 200;  //登录成功
    public static int UNAUTHORIZED = 401;   //未登录
    public static int FORBIDDEN = 403;   //无权限
    public static int EXCEPTION_REQUEST_PARAMS = 50001;   //参数异常
    public static int EXCEPTION_BUSINESS = 50002;         //业务逻辑异常
    public static int PRODUCTION_PAY_NONE = 101;       //用户没购买
    public static int PRODUCTION_OUT_DATE = 102;      //用户购买过期
    public static int AUTHORIZED = 201;      //用户已注册

    public static HttpHeaders getHeaders(Context mContext) {
        HttpHeaders headers = new HttpHeaders();
        HeaderManage headerManage = HeaderManage.getInstance();
        headers.put("channel", "HuaWeiEDU");
        headers.put("packageName", AppUtils.getLocalPackageName(mContext));
        headers.put("versionName", "1.0");
        headers.put("userName", headerManage.getUserName());
        headers.put("sessionToken", headerManage.getSessionToken());
        headers.put("userId", headerManage.getUserId());
        headers.put("platform", "android");
        return headers;
    }

    //是否为生产环境
//    public static boolean isForMalUrl() {
//        return C.getPreference(Constants.LINK_MODE, 1) == 2;
//    }

    /**
     * 通用Api host
     */
    public static String API_BASE_URL = "https://www.goodfatherapp.com/";
//    public static String API_BASE_URL = "https://www.12306.cn/index/";
//    public static String API_BASE_URL = "http://test.goodfatherapp.com/";
    public static String API_TEST_BASE_URL = "http://test.goodfatherapp.com/";

    public static String API_STATIS_BASE_URL = "https://statis.goodfatherapp.com/";
//    public static String API_STATIS_BASE_URL = "http://test-statis.goodfatherapp.com";

    public static String CN_CERT = "CN=*.goodfatherapp.com";

    /**
     * 教材分类获取出版社
     */
    public final static String TEXTBOOK_PUB_LIST_URL = "tv/textbookPubList";
    /**
     * 教材列表
     */
    public final static String TEXTBOOK_LIST_URL = "tv/textbookList";
    /**
     * 教材详情
     **/
    public final static String BOOK_DETAIL_URL = "/book/bookDetail";

    public final static String BOOK_DETAIL_1_URL = API_BASE_URL + "book/fastBookDetail";
    /**
     * 书本商品信息新接口
     */
    public final static String BOOK_PRODUCTION_URL = "production/bookDetail";
    /**
     * 商品详情
     */
    public final static String PRODUCTION_DETAIL_URL = API_BASE_URL + "production/detail";
    /**
     * 华为vip解锁课本
     */
    public final static String HUAWEI_VIP_UNLOCK_BOOK_URL = API_BASE_URL + "vip/channelVipUnlockTextbook";
//    /**
//     * 华为验签
//     */
//    public final static String HUAWEI_SIGN = "huaWeiEdu/sign";
    /**
     * 华为教育中心登录
     */
    public final static String HUAWEI_LOGIN = "huaWeiEdu/login";
//    /**
//     * 获取 bookId
//     */
//    public final static String HUAWEI_GET_BOOKID = "huaWeiEdu/id";



}
